/**
 * @Author: 焦质晔
 * @Date: 2019/6/20
 * @Last Modified by: 焦质晔
 * @Last Modified time: 2019-11-30 15:49:43
 */
import axios from '@/api/fetch';
import SERVER from '@/api/server';

// 执行礼品采购入库单查询
export const getGiftPurchaseStorage = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/queryGiftPurchaseStorage`, {
    params
  });

// 执行礼品采购调差单查询
export const queryAdjustGiftPurchaseStorage = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/queryAdjustGiftPurchaseStorage`, {
    params
  });

// 执行礼品采购入库单明细查询
export const getGiftPurchaseStorageDetail = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/queryGiftPurchaseStorageDetail`, {
    params
  });

// 保存或编辑礼品采购入库单
export const getsaveOrGiftPurchaseStorage = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/saveOrGiftPurchaseStorage`, params);

// 保存或编辑礼品采购入库单(采购调差入库)
export const saveOrGiftPurchaseAdjustStorage = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/saveOrGiftPurchaseAdjustStorage`, params);

// 执行礼品单查询
export const getGiftPage = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/queryGift`, {
    params
  });

// 执行礼品单查询（采购调差入库）
export const queryAdjustGift = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/queryAdjustGift`, {
    params
  });

// 删除记录
export const deleteById = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/deletePurchaseStorage`, {
    params
  });

// 删除明细记录
export const deleteByIds = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/deletePurchaseStorageDetail`, {
    params
  });
// 执行入库
export const executeGiftPurchaseStorage = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/executeGiftPurchaseStorage`, params);

// 详情页执行采购入库
export const detailsExecuteGiftPurchaseStorage = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/detailsExecuteGiftPurchaseStorage`, params);

// 获取采购类型
export const getPurchaseTypes = params =>
  axios.get(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/getPurchaseTypes`, {
    params
  });

// 通过仓库获取库位
export const LibraryDefinition = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/LibraryDefinition`, {
    params
  });

// 获取仓库
export const getStorageList = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/findUserControlStorageCode`, {
    params
  });

// 获取供应商列表
export const businessCustomer = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/businessCustomer`, {
    params
  });

// 供应商下拉
export const getProvider = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/businessCustomer`, {
    params
  });

// 查询所有员工
export const getAllUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);

// 获取仓库类型 加权平均(80851001)/个别计价(80851002)
export const getStorageType = params =>
  axios.get(`${SERVER.DMSCLOUD_PART}/basedata/WarehouseDefinition/storage`, {
    params
  });
// 包含是否打印相关标识
export const doSearchAbout = params => axios.post(`${SERVER.SYSMANAGE}/params/doSearch`, params);

// 根据礼品代码查询礼品库存中的库位信息
export const queryGiftStorageLocationCode = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/queryGiftStorageLocationCode`, params);

// 批量调整入出库价格
export const adjustPrice = params => axios.post(`${SERVER.MEMBERS_CLUB}/giftPurchaseStorage/adjustPrice`, params);
